package org.example.erat.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * 学生数据传输对象
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class StudentDTO {

    private Long id;

    @NotBlank(message = "学号不能为空")
    @Pattern(regexp = "^\\d{5,12}$", message = "学号必须为5-12位数字")
    private String studentId;

    @NotBlank(message = "姓名不能为空")
    private String name;

    private String grade;

    private String major;

    private Long classId;

    private String className;
}
